package com.itheima.config;

import com.itheima.filter.LoginFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

//@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean myFilterRegistration() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new LoginFilter());
        registration.addUrlPatterns("/*");// 拦截路径
        registration.setName("LoginFilter");// 拦截器名称
        registration.setOrder(1);// 顺序
        return registration;
    }

}
